package com.dhecp.project.purchase.service;

import com.dhecp.common.core.domain.AjaxResult;
import com.dhecp.project.purchase.domain.*;

import java.util.List;
import java.util.Map;

public interface PurchaseOrderService {

    /**
     *@Description: 查询前一单NID、BID
     *@Param: nid 必要参数：当前 单据编码
     *@return: AjaxResult (data.nid 前一单NID， data.bid 前一单BID)
     *@Author: hlf
     *@date: 2022-05-09 9:35
     */
    AjaxResult queryLastNid(Map<String, Object> params) throws Exception;

    /**
     *@Description: 查询后一单NID、BID
     *@Param: nid 必要参数：当前 单据编码
     *@return: AjaxResult (data.nid 后一单NID， data.bid 后一单BID)
     *@Author: hlf
     *@date: 2022-05-09 9:40
     */
    AjaxResult queryNextNid(Map<String, Object> params) throws Exception;

    /**
     *@Description: 查询指定单nid的首记录
     *@Param: nid 必要参数：当前 单据编码
     *@return: com.dhecp.project.hr.domain.PurchaseOrder
     *@Author: hlf
     *@date: 2022-05-09 9:40
     */
    PurchaseOrder queryFirstRecord(Map<String, Object> params) throws Exception;

    /**
     * 获取采购订单（根据采购订单号）
     *@Param: bid 采购订单号
     */
    PurchaseOrder selectOneByBid(String bid);

    /**
     *@Description: 查询指定单nid的整单录
     *@Param: nid 必要参数：当前 单据编码
     *@return: java.util.List<com.dhecp.project.hr.domain.PurchaseOrder>
     *@Author: hlf
     *@date: 2022-05-09 9:41
     */
    List<PurchaseOrder> queryListByNid(Map<String, Object> params) throws Exception;

    /**
    *@Description: 根据Guid 查询子件数据
    *@Param: [pGuid]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchaseOrderSon>
    *@Author: hlf
    *@date: 2022-08-22 13:48
    */
    List<PurchaseOrderSon> querySonList(String pNid) throws Exception;

    /**
     *@Description: 查询
     *@Param: [params]
     *@return: java.util.List<com.dhecp.project.hr.domain.PurchaseOrder>
     *@Author: hlf
     *@date: 2022-05-09 9:41
     */
    List<PurchaseOrder> queryList(Map<String, Object> params) throws Exception;
    List<PurchaseOrder> selectAllOrder(Map<String, Object> params) throws Exception;

    /**
    *@Description: 导出专用查询
    *@Param: [params]
    *@return: java.util.List<com.dhecp.project.purchase.domain.PurchaseOrder>
    *@Author: hlf
    *@date: 2023-01-11 14:57
    */
    List<PurchaseOrder> queryExportList(Map<String, Object> params) throws Exception;


    /**
     *@Description: 获取已选中的母件商品
     *@Param: code
     *@return: java.util.List<com.dhecp.project.business.domain.ProductBasis>
     *@Author: hlf
     *@date: 2022-08-19 9:00
     */
    List<PurchaseOrder> querySelectList(Map<String, Object> params) throws Exception;

    /**
     *@Description: 根据母件获取之间
     *@Param: [params]
     *@return: java.util.List<com.dhecp.project.purchase.domain.PurchasePlanSon>
     *@Author: hlf
     *@date: 2022-08-20 14:46
     */
    List<PurchaseOrderSon> querySonListByPNid(Map<String, Object> params) throws Exception;

    /**
     *@Description: 根据BID获取退货数据
     *@Param: [params]
     *@return: java.util.List<com.dhecp.project.purchase.domain.PurchaseOrder>
     *@Author: hlf
     *@date: 2022-08-20 14:46
     */
    List<Refund> querySonListByBID(Map<String, Object> params) throws Exception;

    /**
     *@Description: 保存
     *@Param: moduleTable 必要参数：功能唯一标识
     *@Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:41
     */
    AjaxResult saveData(Map<String, Object> params);

    /**
     * 更新1688店铺优惠ID
     * @param bid 订单号
     * @param aliPromotionId 查到的优惠ID
     * @return
     */
    AjaxResult updateAliPromotionId(String bid, String aliPromotionId);

    /**
     *@Description: 删除
     *@Param: [params]
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:42
     */
    AjaxResult deleteData(Map<String, Object> params);

    /**
     *@Description: 修改删除标志（预留）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串（仅需 guid 和 deleted）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:42
     */
    AjaxResult updateDeleted(Map<String, Object> params);

    /**
     *@Description: 流转  —— 添加流程任务、修改流程状态及生效标志
     *@Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:42
     */
    AjaxResult updateFlowGo(Map<String, Object> params);

    /**
     *@Description: 退回  —— 添加流程任务、修改流程状态及生效标志
     *@Param: infoMap 必要参数：非网格字段（包括头部、底部所有显示和隐藏的字段）
     *@Param: infoItems 必要参数：对应实体类的json格式字符串（仅需 guid）
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-05-09 9:44
     */
    AjaxResult updateFlowBack(Map<String, Object> params);



    /**
     *@Description: 修改审核状态
     *@Param: guid 唯一标识
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-08-17 14:56
     */
    AjaxResult updateType(Map<String, Object> params);


    /**
     *@Description: 判断是否全部生成审核
     *@Param: guid 唯一标识
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-08-17 14:56
     */
    List<PurchaseOrder> isAllAudit(String[] ids) throws Exception;

    /**
     *@Description: 修改物流信息
     *@Param: guid 唯一标识
     *@return: com.dhecp.common.core.domain.AjaxResult
     *@Author: hlf
     *@date: 2022-08-17 14:56
     */
    AjaxResult saveLogistics(Map<String, Object> params);


}
